<?php
require_once('../lib/standard.php');
global $pineza;
$pineza = new Globals();

?>
<link rel="stylesheet" type="text/css" href="<?php print $pineza->server; ?>login/login.css" />
<script type="text/javascript" src="<?php print $pineza->server; ?>login/login.js"></script>
<?php arxi_selidas(); ?>
<?php

if (perastike('login') && ($_REQUEST['login'])) $login = $_REQUEST['login'];
else $login = '';

if (perastike('kodikos') && ($_REQUEST['kodikos'])) $kodikos = $_REQUEST['kodikos'];
else $kodikos = '';

if ($login && $kodikos) {
	$user = new User($login, sha1($kodikos));
	if ($user->login) {
		$_SESSION['login'] = $login;
		?>
		<script type="text/javascript">
			self.location = pineza.server + 'index.php';
		</script>
		<?php
	}
	else {
		lathos('Access denied');
	}
}
if (perastike('lostcon')) {
	lathos('*** Lost connection ***');
}
?>
<form id="main" name="login" method="post" class="main" action="<?php
	print $pineza->server; ?>login/index.php">
<table class="forma">
<tr>
<td class="tbldbg" colspan="10">
	<div class="formaHeader">
		<span class="formaHeaderText">
			<?php print "Login Form"; ?>
		</span>
	</div>
</td>
</tr>

<tr>
<td class="protropi tbldbg">
	Login
</td>
<td class="tbldbg">
	<input type="text" name="login" value="<?php print $login; ?>" maxlength="40"
		size="40" class="pedio" />
</td>

<tr>
<td class="protropi tbldbg">
	Password
</td>
<td class="tbldbg">
	<input type="password" name="kodikos" value="<?php print $kodikos; ?>" maxlength="40"
		size="40" class="pedio" />
</td>

</tr>
</table>
<input type="submit" value="Login" class="fButton" />
<input type="submit" value="Reset" class="fButton" onclick="return(resetLogin(this.form));" />
<input type="submit" value="Cancel" class="fButton" onclick="return(cancelLogin(this.form));" />
</form>
<?php
telos_selidas();
?>
